module LED(
    input           sys_clk,
    input           rst_n,
    output reg[3:0] led
);

//reg counter
reg[31:0]  timer;

//seconds counts
localparam SYSCLK = 32'd5;
localparam SEC_4 = (SYSCLK * 4) - 1;
localparam SEC_3 = (SYSCLK * 3) - 1;
localparam SEC_2 = (SYSCLK * 2) - 1;
localparam SEC_1 = (SYSCLK * 1) - 1;

// timer 
always @(posedge sys_clk or negedge rst_n)
    begin
        if (~ rst_n)
            timer <= 32'd0;
        else if (timer == SEC_4)
            timer <= 32'd0;
        else
            timer <= timer + 1'b1;
    end

// control LED single wire
always @(posedge sys_clk or negedge rst_n)
    begin
        if (~ rst_n)
            led <= 4'b0000;
        else
            if (timer == SEC_1)
                led <= 4'b0001;
            else if (timer == SEC_2)
                led <= 4'b0010;
            else if (timer == SEC_3)
                led <= 4'b0100;
            else if (timer == SEC_4)
                led <= 4'b1000;
    end

endmodule